import React from 'react';
import { Button, message } from 'antd';
import Modal from 'src/components/Modal/index';
import CommonList from 'src/components/CommonLists/list';
import services from 'src/services/api';

export default class extends CommonList {
  constructor(props) {
    super(props);
    this.api = 'strategyComponent';
    this.operatorWidth = 160;
    this.state = {
      events: [],
    };
    this.copyButton = (record) => {
      return (
        <Button
          size='small'
          type='link'
          disabled={record.audit_status === this.AUDIT._WAIT}
          onClick={() => alert('暂未开发')}
        >
          复制
        </Button>
      );
    };

    this.navButton = (record) => {
      return (
        <Button
          size='small'
          type='link'
          disabled={record.audit_status === this.AUDIT._WAIT}
          onClick={() => alert('暂未开发')}
        >
          版本
        </Button>
      );
    };
    this.quoteButton = (record) => {
      return (
        <Button
          size='small'
          type='link'
          disabled={record.audit_status === this.AUDIT._WAIT}
          onClick={() => alert('暂未开发，待流程完了才能做')}
        >
          引用
        </Button>
      );
    };
    this.btnGroup = [this.editButton, this.delButton, this.copyButton, this.navButton];
  }
  componentDidMount() {}

  test = () => {};

  // 打开新版本
  openVersion(id) {
    this.props.history.push(`/strategy/component/${id}/version`);
  }
}
